package com.quectel.sys.module.sys.dto;

import com.quectel.constant.global.valid.ValidDivideGroupOne;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author rananxin
 */
@Data
public class SysUserDto implements Serializable {

    private Long id;
    /**
     * 账号
     */
    @NotBlank(groups = {Default.class, ValidDivideGroupOne.class})
    @Length(min = 1, max = 80)
    private String account;
    /**
     * 用户名
     */
    @NotBlank(groups = {Default.class, ValidDivideGroupOne.class})
    @Length(min = 1, max = 80)
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 手机号
     */
    @NotBlank
    @Length(min = 11, max = 11)
    private String mobile;
    /**
     * 邮箱
     */
    @Email
    private String email;
    /**
     * 0锁定1正常
     */
    private Byte status;
    /**
     * 头像
     */
    private String headImg;
    /**
     * 组id
     */
    private Long groupId;
    /**
     * 是否为租户顶级用户 1是 0否
     */
    private Byte isTenantAdmin;
    /**
     * 租户id
     */
    private Long tenantId;

    /**
     * 默认 2099-12-31 23:59:59
     */
    @NotNull
    private Date expiredTime = new Date(4102415999000L);

    /**
     * 创建人
     */
    private String creator;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 修改人
     */
    private String editor;
    /**
     * 修改时间
     */
    private Date editTime;


    /**
     * 验证码唯一标识
     */
    private String captchaId;
    /**
     * 验证码
     */
    private String captcha;
    /**
     * 角色list
     */
    private List<SysRoleDto> userRoleList = new ArrayList<>();
    /**
     * 用户所属组
     */
    private SysGroupDto sysGroup;
    /**
     * 所属租户
     */
    private SysTenantDto sysTenant;
    /**
     * 0未冻结 1已冻结
     */
    private Byte isFrozen;

}
